package com.sitanyun.merchant.guide.adapter;

import android.content.Context;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sitanyun.merchant.guide.R;
import com.sitanyun.merchant.guide.bean.AnalyDialsuserBean;

/**
 * Created by jzl
 * on 2022/3/25.
 * 经营分析适配器
 */
public class AnalallAdapter extends BaseQuickAdapter<AnalyDialsuserBean.DataBean.ListBean, BaseViewHolder> {

    public AnalallAdapter(Context context) {
        super(R.layout.layout_alluser);
        this.mContext = context;
    }

    /**
     * @param helper
     * @param item
     */
    @Override
    protected void convert(BaseViewHolder helper, AnalyDialsuserBean.DataBean.ListBean item) {
       helper.setText(R.id.user_tv,"");
       helper.setText(R.id.user_time,item.getStartTime()+"");
        View views= helper.getView(R.id.views);
        if (helper.getPosition()>0){
            views.setVisibility(View.VISIBLE);
        }else {
            views.setVisibility(View.INVISIBLE);
        }
       switch (item.getBehavior()){
           case "BROWSE":
               helper.setText(R.id.user_tv,item.getCname()+"打开"+item.getSceneName());
               break;
           case "BROWSE_END":
               helper.setText(R.id.user_tv,item.getCname()+"离开场景");
               break;
           case "MESSAGE":
               helper.setText(R.id.user_tv,item.getCname()+"留言");
               break;
           case "CALL":
               helper.setText(R.id.user_tv,item.getCname()+"要求回电");
               break;
           case "MEETING":
               helper.setText(R.id.user_tv,item.getCname()+"同屏讲解，"+"客服姓名"+item.getStaffName());
               break;
           case "SAHRE":
               helper.setText(R.id.user_tv,item.getCname()+"分享了"+item.getSceneName()+"的场景");
               break;
           case "LOGOUT":
               helper.setText(R.id.user_tv,item.getCname()+"离开");
               break;
           case "SWITCH":
               helper.setText(R.id.user_tv,item.getCname()+"查看"+item.getSceneName()+"下的"+item.getSubSceneName());
               break;

       }

    }
}